package com.zhixing.web.repository;

import com.zhixing.web.api.dataobject.entity.Menu;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author dzh
 * @version 1.0.0.05020
 * <p>project: d-blog</p>
 * <p>created time: 2022/05/09 15:32</p>
 * <p>describe: 菜单信息持久层</p>
 * <p>remarks: </p>
 **/
@Repository
public interface MenuRepository {

    @Select("select * from d_blog_menu where is_close = #{isClose} order by menu_sort")
    List<Menu> findAll(Menu menu);

    @Select("select * from d_blog_menu where is_close = #{menu.isClose} limit #{pagenum}, #{pageSize}")
    List<Menu> findAllForPage(@Param("menu")Menu menu, @Param("pagenum")int pageNum, @Param("pageSize")int pageSize);
}
